|
|
|
|
|
|
|
Describing the Classes in the Subsystem |
|
|
|
|
|
|
|
|
The form, frmLogin, captures the user's ID and password. Security enforces the security policy of the enterprise at the application level. The classes Role, AllRoles, and SupervisorRole implement behavior relative to a particular role or set of roles. The class AllRoles is owned by the Workgroup, which keeps track of which user can implement which roles and which tasks belong to which role. Workgroup and Workgroups are classes that track the workgroups that exist in the application domain. Workgroups is a collection of workgroup objects. |
|
|
|
|
|
|
|
|
Process tracks the sequence of tasks that must be implemented to produce the workgroup's meaningful product. This class also knows which task is the current task and communicates with the Workgroup class to know which role is the current role. AllProcesses is a collection of Process objects and is necessary for environments where the number of processes supported by a given workgroup will expand some time in the future. As a good policy for developing commercial- and industrial-grade object-oriented applications, always include such a collection. |
|
|
|
|
|
|
|
|
The User and CSession classes track the user as well as information about the current user session, such as login and logoff times. You could expand this functionality to track every transaction of the user, which is useful for security audit and technical support purposes. Here, the capital C in CSession means controller. The CSession class owns the SHA1Encryption class, which is responsible for encrypting the password. |
|
|
|
|
|
|
|
|
The class AccountTransactionsGroup is the workgroup class implemented in the Second Bank of Carrollton example. It has two roles, BankTellerRole and ManagerRole. |
|
|
|
|
|
|
|
|
The collection classes AllProcesses and AllRoles each have an Add method. The purpose of this method is to add a Process and Role object, respectively, to each collection. Each collection's Remove method removes each object from each collection. |
|
|
|
|
|
|
|
|
The controller class, CSession, controls events and state changes with respect to a logged-in session. It also controls the form, frmLogin. The class has the following methods: |
|
|
|
|
|
|
|
|
The method authenticate is responsible for the login process. It works in conjunction with the showForm method to display the login form to the user. |
|
|
|
|
|